how to solve linear equations with brackets